About Compilers 2.03 ©FaceWare 1986-92. All Rights Reserved. Introduction The following notes describe language- and compiler-specific issues encountered when programming with FaceWare modules, and assume that you have read the "About FaceWare" program on the Utilities disk, or the "Startup" topics in ViewIt's on-line documentation. A Blessing & A Burden The fact that FaceWare modules are language- and compiler-independent is a blessing for the programmer, but a burden for the module developer who must create example programs and interface files that are language- and/or compiler-specific. This is balanced by the fact that most modules have relatively simple programming interfaces, making for simple example programs that are easily translated. FaceWare modules distributed by FaceWare always include at least one example or "demo" program writtin in C, Pascal, and Fortran. The C and Pascal programs are typically written using the THINK compilers, but the source can also be compiled using the MPW C and Pascal compilers. The modules shipped with ViewIt include Fortran programs for the 3 popular Fortran compilers from Absoft and Language Systems, but other modules often include just a single Fortran demo program written with whatever Fortran compiler was available to the developer. Language Differences For the most part, programs written in C, Fortran, or Pascal can be directly translated from one language to another on a line-by-line basis. (If you don't believe this, compare the example programs shipped with each FaceWare module.) Most differences between languages that affect FaceWare programmers involve just four areas: numbers, pointers, strings, and support for jumping to code resources. The latter problem is handled by providing pre-done, compiler-specific "StorXY" and "ProcXY" include files. Other topics in this program review the use of numbers, pointers, and strings with different languages. Compiler Versions & Abbreviations FaceWare documentation uses "XY" as a generic compiler abbreviation and the following for specific compilers: LC = THINK C 5.0.2 (617-275-4800) WC = MPW C 3.2 (APDA: 800-282-2732) LF = MPW Language Systems Fortran 3.0 (703-478-0181) MF = Absoft MacFortran 2.4 (313-853-0050) AF = MPW Absoft MacFortran II 3.1 (313-853-0050) LP = THINK Pascal 4.0.1 (617-275-4800) WP = MPW Pascal 3.2 (APDA: 800-282-2732) where the version numbers correspond to the current versions as of January 1992, and the company phone numbers are included in case you need to order an upgrade or get technical support. Compiler upgrades have always presented us with problems. If we ship examples using the latest version of a compiler, then this causes problems for programmers who have not yet upgraded their compilers. If we ship examples using earlier versions, then programmers who have upgraded their compilers complain that we should upgrade our examples! This is compounded by the fact that successive compiler versions are often not compatible with one another, or address bug fixes and compatibility issues that make it difficult for us to not upgrade our example programs. The latest round of compiler upgrades, for example, address 32-bit & 68040 compatibility issues that require us to use these latest versions to produce programs that will work with all Macintoshes and System versions. The best solution is for you to use the latest version of your compiler. If using an earlier version, our example programs may or may not compile without modification. Call us if you have any problems. MPW C & Pascal Programmers The latest versions of THINK C & Pascal are very nearly source-compatible with the MPW compilers. When compiling the THINK Pascal examples with MPW Pascal, remove the "{$I-}" directive which is used in THINK programs to turn off automatic toolbox initializations. Both MPW C and Pascal users will also need to expand the include file lists to include a larger number of toolbox-related include files.